package com.example.callbackservice.controller;

import com.example.api.service.CallbackService;
import com.example.common.core.AjaxResult;
import com.example.common.entity.ConfigCallbackDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @author Destinycc
 */
@RestController
@Slf4j
@RequestMapping("/callback")
public class CallBackController {
    @Reference
    CallbackService callbackService;

    @PostMapping("/config")
    public AjaxResult config(@RequestBody @Valid ConfigCallbackDTO callbackDTO) {
        return callbackService.configCallback(callbackDTO);
    }
}
